<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function Person(name,age,sex){
            this.name=name;
            this.age=age;
            this.sex=sex;

            Person.prototype.run=function(){
                console.log("我能跑步");
            }
            Person.eat=function(food="肉"){
                console.log("我喜欢吃"+food+"!");
            }
        }


        function Student(num,name,age,sex){
            this.num=num;
            Person.bind(this,name,age,sex)();
        }

        var stu=new Student(111,"黄总",20,"男");
        console.log(stu);
    </script>
</body>
</html>